package com.eryos.android.cigarettecounter.database;

/**
 * Project : CigaretteCounter Author : Olivier Combe URL : http://eryos.fr/CigaretteCounter/
 * 
 * Copyright(C)2011 - Olivier Combe
 * 
 * Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 * 
 * @version \$Revision.*\$
 * @author Olivier Combe
 */
public final class DBFields {

    /**
     * Default (private) constructor.
     */
    private DBFields() {

    }

    /** TODAY clause. */
    public static final String THIS_DAY = "strftime('" + DBTools.DATE_FORMAT + "', " + DBTools.getNow() + ")";

    /** This Week clause. */
    public static final String THIS_WEEK = "strftime('" + DBTools.WEEK_FORMAT + "', " + DBTools.getNow() + ")";

    /** Previous Week clause. */
    public static final String PREVIOUS_WEEK = "strftime('" + DBTools.WEEK_FORMAT + "', " + DBTools.getNow()
            + ", '-7 days')";
    /** This Month clause. */
    public static final String THIS_MONTH = "strftime('" + DBTools.MONTH_FORMAT + "', " + DBTools.getNow() + ")";

    /** Previous Month clause. */
    public static final String PREVIOUS_MONTH = "strftime('" + DBTools.MONTH_FORMAT + "', " + DBTools.getNow()
            + ", '-1 months')";

    /** Last six weeks clause. */
    public static final String SIX_WEEKS_AGO = "strftime('%Y-%W', " + DBTools.getNow() + ", '-"
            + DBTools.NUMBER_OF_HISTORY * 7 + " days')";

    /** Last six months clause. */
    public static final String SIX_MONTHS_AGO = "strftime('%Y-%m', " + DBTools.getNow() + ", '-"
            + DBTools.NUMBER_OF_HISTORY + " months')";

    /** This week value . */
    public static final String DB_WEEK = "strftime('" + DBTools.WEEK_FORMAT + "', " + DBConnector.TIME_COLUMN + ")";

    /** Counter. */
    public static final String COUNT = "count(1)Nb";

    /** This Week filter. */
    public static final String FILTER_THIS_WHEEK = DB_WEEK + " = " + THIS_WEEK;

    /** Current date. */
    public static final String DATE = "strftime('" + DBTools.DATE_FORMAT + "', " + DBConnector.TIME_COLUMN + ")";
}
